<script setup lang="ts">
import TestComponents from "@/components/TestComponents.vue";
import styles from "@/style/styles";
import { ref } from 'vue';
const id = ref(true)
const cli = ()=>{
    debugger
    id.value = !id.value
    console.log(id.value)
    console.log(styles)
}
</script>

<template>
    <!-- vue 通过key重新加载组件 v-if 也可以 v-show 不重新加载组件 template 不加入到dom中-->
    <div>
        <ul>
            <li @click="cli">点击</li>
        </ul>
    </div>

    <template v-if="id">
        {{ styles }}
        <TestComponents :id="1" v-show="id" ></TestComponents>
    </template>

</template>


